<template>
	<activity-list :data="activities" @handleClick="handleSelfActive"></activity-list>
</template>

<script>
	import {
		getSchoolQuestionActives
	} from "@/api/school/index.js"
	export default {
		data() {
			return {
				activities: [],
			}
		},
		computed: {
			schoolId() {
				return this.$store.state.user.schoolId
			},
		},
		methods: {
			getActives() {
				let schoolId = this.schoolId

				getSchoolQuestionActives(schoolId).then(res => {
					this.activities = res.activities
				})
			},
			handleSelfActive(activity) {
				this.$tab.navigateTo('/pages/school-index/school-self-check?id=' + activity.id)
			}
		},
		onLoad: function() {
			this.getActives()
		}
	}
</script>

<style>

</style>